//--- Definitions ---
#version 120

#extension GL_EXT_geometry_shader4 : enable

#extension GL_EXT_gpu_shader4 : enable

uniform vec4 normal_cursor;

void main() {

  	vec4 v = gl_PositionIn[0];
  
  	gl_Position = vec4(v.x + 0.03, v.y - 0.015, v.zw);
	EmitVertex();
	gl_Position = vec4(v.x + 0.03, v.y + 0.015, v.zw);
	EmitVertex();	
	
	gl_Position = vec4(v.x + 0.015, v.y + 0.03, v.zw);
	EmitVertex();
	gl_Position = vec4(v.x - 0.015, v.y + 0.03, v.zw);
	EmitVertex();
	
	gl_Position = vec4(v.x - 0.03, v.y + 0.015, v.zw);
	EmitVertex();
	gl_Position = vec4(v.x - 0.03, v.y - 0.015, v.zw);
	EmitVertex();
	
	gl_Position = vec4(v.x - 0.015, v.y - 0.03, v.zw);
	EmitVertex();
	gl_Position = vec4(v.x + 0.015, v.y - 0.03, v.zw);
	EmitVertex();
			
	gl_Position = vec4(v.x + 0.03, v.y - 0.015, v.zw);
	EmitVertex();	
	EndPrimitive();
	
	gl_Position = v;
	EmitVertex();
	gl_Position = v + normal_cursor * 0.1;
	EmitVertex();	
	EndPrimitive();
  
}
